
// 表单校验规则由 schema2code 生成，不建议直接修改校验规则，而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema



const validator = {
  "class_id": {
    "rules": [
      {
        "required": true
      },
      {
        "format": "string"
      }
    ],
    "label": "教学班标识"
  },
  "number": {
    "rules": [
      {
        "required": true
      },
      {
        "format": "int"
      }
    ],
    "label": "人数"
  },
  "optionalNumber": {
    "rules": [
      {
        "format": "int"
      }
    ],
    "label": "可选人数"
  },
  "course_id": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "课程编码"
  },
  "course": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "课程编码"
  },
  "username": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "用户名"
  },
  "day": {
    "rules": [
      {
        "format": "int"
      }
    ],
    "label": "星期"
  },
  "node": {
    "rules": [
      {
        "format": "int"
      }
    ],
    "label": "节次"
  },
  "address": {
    "rules": [
      {
        "format": "array"
      }
    ],
    "label": "地址"
  },
  "classroom": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "课室"
  },
  "start_week": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "开始周"
  },
  "end_week": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "结束周"
  },
  "biweekly": {
    "rules": [
      {
        "format": "int"
      },
      {
        "range": [
          {
            "text": "单双周",
            "value": 0
          },
          {
            "text": "单周",
            "value": 1
          },
          {
            "text": "双周",
            "value": 2
          }
        ]
      }
    ],
    "defaultValue": 0,
    "label": "单双周"
  },
  "roomSchedule": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "课室记录id"
  },
  "parent_id": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "大课Id"
  },
  "comment": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "备注"
  }
}

const enumConverter = {
  "biweekly_valuetotext": {
    "0": "单双周",
    "1": "单周",
    "2": "双周"
  }
}

export { validator, enumConverter }
